package com.dean.ui.panel.impl;

import com.dean.ui.panel.DeanPanel;
import com.dean.ui.utils.UiUtils;

import javax.swing.*;

public abstract class BasePanel implements DeanPanel {
    public JPanel panel;
    public JScrollPane scrollPane;
    public  JPanel showView() {
        // 初始化 panel
        panel = UiUtils.panel();
        // 界面ui布局
        mainUi();
        // 界面脚本
        mainScript();
        // 初始化配置 页面加载完成之后初始化配置
        initProperties();
        return panel;
    }

    public JScrollPane showScrollView(){
        scrollPane = new JScrollPane();
        mainUi();
        mainScript();
        initProperties();
        return scrollPane;

    }

    public abstract void mainUi();

    public abstract void mainScript();
    public abstract void initProperties();
}
